package com.example.finalssm.config;

//import com.shuangdao.springboot_homework.controller.LoginHandlerInterceptor;
import org.springframework.stereotype.Controller;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Controller
public class DirectConfig implements WebMvcConfigurer {
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        //registry.addViewController("/luo").setViewName("index");
       // registry.addViewController("/main.html").setViewName("dashboard");
        registry.addViewController("/index.html").setViewName("index");
        registry.addViewController("/Details.html").setViewName("Details");
        registry.addViewController("/addCount.html").setViewName("addCount");
        registry.addViewController("/addLost.html").setViewName("addLost");
    }
    //添加过滤器
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginHandlerInterceptor()).addPathPatterns("/**").excludePathPatterns("/index.html","/login","/addCount.html",
                "/","/css/**","/addAccount");
    }
}
